package db

import org.hibernate.Session

/**
 * manages operation with folders in front of the database.
 * enables to save, update and delete a folder
 */
class FolderManager(session: Session) {
  if (session == null) {
    throw new RuntimeException("Invalid session object")
  }

  def saveFolder(folder: Folder) {
    session.save(folder)
  }

  def updateFolder(folder: Folder) {
    session.update(folder)
  }

  def deleteFolder(folder: Folder) {
    session.delete(folder)
  }

}